//
//  ZLBaseTableViewController.m
//
//  Created by Jiaozl on 2022/5/19.
//  Copyright © 2022 Duxiaoman. All rights reserved.
//

#import "ZLBaseTableViewController.h"
#import "ZLBaseTableContentView.h"
#import "UIView+Frame.h"
#import <Masonry/Masonry.h>

@interface ZLBaseTableViewController ()
@property (nonatomic, strong) ZLBaseTableContentView *contentView;
@property (nonatomic, strong) NSMutableArray *datas;

@end

@implementation ZLBaseTableViewController

#pragma mark - Life Cycle

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
    [self setupConstraints];
    [self setupData];
}

- (void)dealloc {
    NSLog(@"Jiaozl %s", __func__);
}

#pragma mark - Public Method

- (void)reload {
    [self.contentView updateDataSource:self.datas];
}

#pragma mark - Private Method

- (void)setupUI {
    self.view.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:self.contentView];
}

- (void)setupConstraints {
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self.view);
    }];
}

- (void)bindAction {
    
}

- (void)setupData {
    
}

#pragma mark - Getter

- (ZLBaseTableContentView *)contentView {
    if (!_contentView) {
        _contentView = [[ZLBaseTableContentView alloc] init];
    }
    return _contentView;
}

- (NSMutableArray *)datas {
    if (!_datas) {
        _datas = [NSMutableArray new];
    }
    return _datas;
}


@end
